package com.vini.core.ec;


import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name = "vehicles_master", catalog = "hopon")
public class Vehicle implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	
	private Integer id;
	private User vehicleOwner;
	private int imageId;
	private String make;
	private String model;
	private String color;
	private String registrationNo;
	private String isDefault;
	private Date createdDt;
	private Date updatedDt;
	private int capacity;

		
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(cascade = CascadeType.ALL)
	public User getVehicleOwner() {
		return this.vehicleOwner;
	}

	public void setVehicleOwner(User user) {
		this.vehicleOwner = user;
	}

	@Column(name = "image_id", nullable = false)
	public int getImageId() {
		return this.imageId;
	}

	public void setImageId(int imageId) {
		this.imageId = imageId;
	}

	@Column(name = "make", nullable = false)
	public String getMake() {
		return this.make;
	}

	public void setMake(String make) {
		this.make = make;
	}

	@Column(name = "model", nullable = false)
	public String getModel() {
		return this.model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	@Column(name = "color", nullable = false)
	public String getColor() {
		return this.color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	@Column(name = "registration_no", nullable = false)
	public String getRegistrationNo() {
		return this.registrationNo;
	}

	public void setRegistrationNo(String registrationNo) {
		this.registrationNo = registrationNo;
	}

	@Column(name = "is_default", nullable = false, length = 2)
	public String getIsDefault() {
		return this.isDefault;
	}

	public void setIsDefault(String isDefault) {
		this.isDefault = isDefault;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_dt", nullable = false, length = 19)
	public Date getCreatedDt() {
		return this.createdDt;
	}

	public void setCreatedDt(Date createdDt) {
		this.createdDt = createdDt;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updated_dt", nullable = false, length = 19)
	public Date getUpdatedDt() {
		return this.updatedDt;
	}

	public void setUpdatedDt(Date updatedDt) {
		this.updatedDt = updatedDt;
	}
	@Column(name = "capacity", nullable = false)
	public int getCapacity() {
		return capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}

	@Override
	public String toString() {
		return "Vehicle [id=" + id + ", vehicleOwner=" + vehicleOwner
				+ ", make=" + make + ", model=" + model + ", color=" + color
				+ ", registrationNo=" + registrationNo + ", capacity="
				+ capacity + "]";
	}

}
